package indi.woniu.mapper;

import indi.woniu.entity.Pool;
import indi.woniu.entity.ResponseEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface PoolMapper {
    List<Pool> findByFidAndSunName(@Param("p") Pool pool) ;

    List<Pool> findAll();

    List<Pool> findByName(@Param("name") String name);

    List<Pool> findByType(@Param("p") Pool pool);

    int fMovePool(@Param("p") Pool pool);

    //根据fid查找父题库id
    int findPoolByFid(Integer fid);

    //新增子题库
    int sMovePool(@Param("p") Pool pool);

    //修改题库
    int updatePool(@Param("p") Pool pool);

    //删除题库
    int deletePoolById(int id);

    //查询父题库id存在不
    Integer findByFPool(Integer id);

    //查询儿题库id
    List<Integer> findBySPool(int id);

    //查询儿题库下有无试题 返回值==0,则可以直接删除,不为0不能删除
    int findQuestion(List sPoolId);

    //删除中间表
    int deletePQById(Integer id);

    int findBySId(Integer id);

    int findBySPoolQuestion(int id);
    //无条件查询所有父id
    List<Integer> findAllByFId();
    //无条件查询所有id
    List<Integer> findAllId();
    //通过关键字查找所有父题库

    List<String> findByNameFpool();

    List<String> findSpoolByFName(String poolName);

    List<Pool> findSpools(List fpool);

    List<Integer> findFpool();

    int findSFPool(String name);

    List<Pool> findFidPool(@Param("p") Pool pool);
//无条件查询所有fid
    List <Integer>findAllFidPool();

    List<String> findAllFName();

//新新增父题库
    int insertFpool(@Param("p")Pool pool);

    int insertSpool(@Param("p")Pool pool);

    List<String> findFidSPoolName(@Param("p") Pool pool);

    List<Pool> findSonPoolName(@Param("p") Pool pool);

    List<Pool> findAllAll();

    List<Pool> findAllAllByName(@Param("p") Pool pool);
}
